<?php

namespace app\http\middleware;

use think\Db;

class CheckTruth
{
    public function handle($request, \Closure $next)
    {
        $user = Db::table('yz_member')->where('memb_id', session('user.id'))->find();
        if($user['memb_is_truth'] == 0) {
            return redirect('/index/sender/register');
        }elseif($user['memb_is_truth'] == 1){
            return $next($request);
        }else{
            return redirect('/index/sender/wait');
        }
    }
}
